home *** CD-ROM | disk | FTP | other *** search
- class Platform
- {
- var sType;
- var position;
- var bOnScreen;
- var bmpCanvas;
- var plaPos;
- var plaWidth;
- var radarPos;
- var arrowPos;
- var bmpPlatform;
- var width;
- var screenPos;
- var frame = 0;
- function Platform(sTypeNew, pos)
- {
- this.sType = sTypeNew;
- this.position = pos.clone();
- this.bOnScreen = false;
- this.bmpCanvas = Game.bmpDead;
- var _loc2_ = undefined;
- if(this.sType == "base")
- {
- _loc2_ = "platform hq";
- this.plaPos = new flash.geom.Point(this.position.x + 17,this.position.y - 87);
- this.plaWidth = 90;
- this.radarPos = new flash.geom.Point(166,0);
- }
- else if(this.sType == "refill")
- {
- _loc2_ = "platform refill";
- this.plaPos = new flash.geom.Point(this.position.x + 7,this.position.y - 29);
- this.plaWidth = 84;
- this.radarPos = new flash.geom.Point(131,0);
- }
- else if(this.sType == "dropZone")
- {
- _loc2_ = "platform drop zone";
- this.plaPos = new flash.geom.Point(this.position.x + 0,this.position.y - 0);
- this.plaWidth = 89;
- this.arrowPos = new flash.geom.Point(45,80);
- }
- this.bmpPlatform = flash.display.BitmapData.loadBitmap(_loc2_);
- this.width = this.bmpPlatform.width;
- }
- function draw(leftEdge)
- {
- var _loc2_ = this.position.x - leftEdge;
- var _loc3_ = this.position.y;
- this.screenPos = new flash.geom.Point(_loc2_,_loc3_);
- if(_loc2_ > - this.bmpPlatform.width && _loc2_ < Game.screenW)
- {
- this.bOnScreen = true;
- if(this.frame >= 13 && this.frame <= 36 && this.sType != "dropZone")
- {
- this.drawRadar();
- }
- this.bmpCanvas.copyPixels(this.bmpPlatform,this.bmpPlatform.rectangle,new flash.geom.Point(this.screenPos.x,Game.screenH - this.screenPos.y),null,null,true);
- if((this.frame < 13 || this.frame > 36) && this.sType != "dropZone")
- {
- this.drawRadar();
- }
- if(this.sType == "dropZone")
- {
- this.drawArrow();
- }
- }
- }
- function drawRadar(Void)
- {
- this.frame = this.frame + 1;
- this.frame %= 50;
- var _loc3_ = _root.attachMovie("radar","radar",993);
- _loc3_.gotoAndStop(this.frame + 1);
- var _loc4_ = new flash.geom.Matrix();
- _loc4_.translate(this.screenPos.x + this.radarPos.x,Game.screenH - (this.screenPos.y + this.radarPos.y));
- this.bmpCanvas.draw(_loc3_,_loc4_,null,null,null,true);
- _loc3_.removeMovieClip();
- }
- function drawArrow(Void)
- {
- this.frame = this.frame + 1;
- this.frame %= 10;
- var _loc3_ = _root.attachMovie("arrow","arrow",994);
- _loc3_.gotoAndStop(this.frame + 1);
- var _loc4_ = new flash.geom.Matrix();
- _loc4_.translate(this.screenPos.x + this.arrowPos.x,Game.screenH - (this.screenPos.y + this.arrowPos.y));
- Game.bmpCanvas.draw(_loc3_,_loc4_,null,null,null,true);
- _loc3_.removeMovieClip();
- }
- }
-